// dlg.txt

//MK Edit

//mark_quest_dest(zone,x,y,layer,quest);
//	code =
//		sf(,,2);
//		toggle_quest(19,10);
//		award_party_xp(MED_QUEST_XP);
//	break;

begintalkscript;

variables;

short this_town = 44;

begintalknode;
	tag = 1;
	condition = get_sdf(this_town,1) == 0;
	text1 = "There is a small camp just inside this mine. A few exhausted warriors of the Rokaj are huddled around a smoky fire. When you approach, they slowly reach for their blades. Then they see who you are and calm down again.";
	text2 = "Their leader, a burly, graying man, rises to greet you properly. He rises to his feet. Before he can speak, however, one of the guards points to the campfire and shouts, _Ghosts!_";
	code =
		sf(this_town,1,1);
		spawn_creature(4407);
		spawn_creature(4409);
		set_name(4407,"Wispy Shade");
		set_summon_level(4408,2);
		set_name(4409,"Wispy Shade");
		set_summon_level(4409,2);
	break;
	
begintalknode;
	tag = 2;
	condition = get_sdf(this_town,2) == 0;
	text1 = "There is a large, natural cave in the middle of the mines. It's slightly warm and humid in here, and the stone floor is covered with muck and slime. The clan here has reinforced all of the walls with beams. They've been thorough.";
	text2 = "It is not quiet, though. Shambling humanoid forms, rotten and covered with algae, lurch mindlessly back and forth. They have been reanimated by the weird magic of this mine.";
	code =
		sf(this_town,2,1);
	break;

begintalknode;
	tag = 3;
	condition = get_sdf(this_town,3) == 0;
	text1 = "This tunnel is a recent excavation. The miners here dug this shaft out, looking for new sources of precious cinnabar and crystal.";
	text2 = "You shiver. An icy draft flows out of the darkness to the north. The faint odor of rot and corpse dust makes you feel ill.";
	code =
		sf(this_town,3,1);
	break;

begintalknode;
	tag = 4;
	condition = get_sdf(this_town,4) == 0;
	text1 = "You are at the east edge of a network of crypts. The construction is solid, intact, and ancient. The writing etched into the walls is in an alphabet you can't recognize.";
	text2 = "This place is old enough that it might predate the Ro. Or perhaps the Rokaj have been following their strange traditions up here for thousands of years. The Erudico could spend decades sorting all this out.";
	code =
		sf(this_town,4,1);
	break;

begintalknode;
	tag = 5;
	condition = get_sdf(this_town,5) == 0;
	text1 = "This is the final chamber of this ancient crypt. There is a deep shaft, descending far into the darkness. Icy air rises out of it, carrying the occasional moan to you. The priests of this crypt performed long-forgotten rituals here.";
	text2 = "There is a magic circle on the stone promontory, protruding out over the depths. You find yourself drawn to it.";
	code =
		sf(this_town,5,1);
	break;

begintalknode;
	tag = 6;
	condition = get_sdf(this_town,6) == 0;
	text1 = "__";
	code =
		sf(this_town,6,1);
	break;

begintalknode;
	tag = 7;
	condition = get_sdf(this_town,7) == 0;
	text1 = "__";
	code =
		sf(this_town,7,1);
	break;

begintalknode;
	tag = 8;
	condition = get_sdf(this_town,8) == 0;
	text1 = "__";
	code =
		sf(this_town,8,1);
	break;

begintalknode;
	tag = 9;
	condition = get_sdf(this_town,9) == 0;
	text1 = "__";
	code =
		sf(this_town,9,1);
	break;

begintalknode;
	tag = 10;
	condition = get_sdf(this_town,10) == 0;
	text1 = "__";
	code =
		sf(this_town,10,1);
	break;

begintalknode;
	tag = 11;
	condition = get_sdf(this_town,11) == 0;
	text1 = "__";
	code =
		sf(this_town,11,1);
	break;

begintalknode;
	tag = 12;
	condition = get_sdf(this_town,12) == 0;
	text1 = "__";
	code =
		sf(this_town,12,1);
	break;

// MIXED

begintalknode;
	tag = 13;
	condition = 1;
	text1 = "This mine is ours.";
	text2 = "Talk to Dhregn.";
	text3 = "Dhregn commands.";
	text4 = "A tiring post.";
	text5 = "You have helped us.";
	text6 = "We are grateful.";
	action = SPEECH_BUBBLE;
	code =
		cs();
		if (gf(44,11) == 0)
			as(get_ran(1,1,4));
			else as(get_ran(1,1,6));
	break;

begintalknode;
	tag = 14;
	condition = 1;
	text1 = "The ground vibrates under your feet. The quiet moaning in the distance starts to grow louder. It is clearly audible. Then almost deafening.";
	text2 = "A wisp of mist rises out of the grate behind you. It solidifies into a faint, unstable ghost. The features are strange. The armor is crude. It cries something out at you in a lost language.";
	text3 = "As it flows toward you, more mist rises out of the grate. The crumbling crypt is venting what little remains of its strength out against you.";

begintalknode;
	tag = 15;
	condition = 1;
	text1 = "A final voluminous cloud of mist rises out of the western grate. It forms into the crude parody of a once-living being. Not a warrior of a forgotten tribe. It is a huge, reptilian form.";
	text2 = "Maybe this was the god of this lost tribe. It rises from the dead, the last gasp of their rage against the living.";

begintalknode;
	tag = 16;
	condition = 1;
	text1 = "Your blade passes through the druid ghost. She begins to fade away. As it falls apart, she says a final curse. Or maybe it's a plea for understanding. Or a final request.";
	text2 = "You can't be sure. The last living person who could understand what she is saying died over a thousand years ago. Soon, she is gone forever.";
	text3 = "The crypt instantly grows calmer and quieter. The ghosts are gone, their power dispelled. The mine has been reclaimed for the living.";
		
begintalknode;
	tag = 17;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 18;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 19;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 20;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 21;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 22;
	condition = 1;
	text1 = "__";

////

begintalknode;
	tag = 30;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "One of the exhausted warriors guarding the tunnel steps forward to greet you. He's an older man, the leader here. You can now see that their weapons and armor are shiny and almost new. They look like they're new arrivals from the coast.";
	text2 = "He looks at the insignia on your shoulder and bows deeply. _Welcome, honored Haven. We did not expect to ever see you here, but ... The Oravera Claim is an interesting place._";
	text3 = "_I am Dhregn Stoff. Welcome to our miserable little hole._ You can hear ominous moans coming from the dark tunnels.";
	text5 = "Dhregn Stoff motions for you to sit by him, staring north into the ominous darkness. He offers you tea and rock-hard rolls and chats with you, as his warriors try to rest.";
	action = INTRO;

begintalknode;
	state = 10;
	nextstate = 11;
	condition = 1;
	question = "_Tell me about this claim._";
	text1 = "_It is the hope of our clan. It cost us much to buy this mine, and it has great promise. If we fail, ruin. If we succeed, prosperity._";

begintalknode;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "_How did you get the claim?_";
	text1 = "_We gave gold to a clan who held it but could not work it. To the wild Ro of upward, that means we are weak and shouldn't hold the land._";
	text2 = "He shrugs. _If we can hold it after what we faced, all will see we are strong enough._";

begintalknode;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "_Why did you leave the coast?_";
	text1 = "_It is safe and warm, but it is utterly claimed and settled. It is a place to live but not to strike out and become strong._";

begintalknode;
	state = 11;
	nextstate = 12;
	condition = 1;
	question = "_What are you mining for here?_";
	text1 = "_Cinnabar. An ore that, when processed, produces a trickle of precious, valuable quicksilver. Selling our cinnabar will make our little clan strong._";

begintalknode;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "_Who processes the ore?_";
	text1 = "_There are factories. The Erudico have a few workshops as well. The Rokaj has proper industry now. It was brought to us, placed, and protected by Haven._";
	text2 = "_The Gentle Coast is the only land that appreciates the poverty and danger Haven prevents._";

begintalknode;
	state = 12;
	nextstate = -1;
	condition = gf(43,16) < 2;
	question = "_I could use more quicksilver for my forts._";
	text1 = "Dhregn thinks about this. _Perhaps we can help with this. Once this mine is producing again, we could give Haven a share, but only if our problems are solved._";
	text2 = "_Our leader is in Jajayim. Kieron Stoff. You should talk to him._";

begintalknode;
	state = 10;
	nextstate = 13;
	condition = 1;
	question = "_You are up here from the Gentle Coast?_";
	text1 = "_Yes, and we are not ashamed of it. The other provinces look down on us. See us as outsiders, weaklings, not Ro. The High Lithans will trade with us, but they will not look us in the eye._";

begintalknode;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "_Are you in danger from them?_";
	text1 = "_I don't think so. We are still Ro, a little, and the High Lithans are judges, not assassins. They will be polite to us. Then they will mock us when we leave._";
	text2 = "_Except, we will not leave._";

begintalknode;
	state = 13;
	nextstate = 14;
	condition = 1;
	question = "_Why do they have so much contempt for you?_";
	text1 = "_We are the ones who trade with the outside world. Who run the trade, who bring the Rokaj wealth and knowledge. Many hate the Gentle Coast because it is wealthy and comfortable, as if that is a sin._";
	text2 = "_They think we have forgotten our land's ways. They think we have no Deep Truth._";

begintalknode;
	state = 14;
	nextstate = -1;
	condition = 1;
	question = "_And do you have a Deep Truth?_";
	text1 = "He snorts. _Of course! Our Deep Truth is that the thing that is best for our people is the thing that is best. We are safe. We are not hungry. We only have the violence we bring upon ourselves._";
	text2 = "_Our Deep Truth is that is good, and our Deep Truth is actually true._";

begintalknode;
	state = 10;
	nextstate = 15;
	condition = gf(44,11) == 0;
	question = "_You seem to have a ghost problem._";
	text1 = "They laugh. _You are very observant, [P] of Haven. Yes. We mined for wealth. We struck a vein of ghosts instead. Mindless, screeching spirits._";
	text2 = "_Since then, we have been struggling to hold the claim. We asked Misttalkers for help, but ..._ He shakes his head.";
	
begintalknode;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "_Misttalkers?_";
	text1 = "_The ghost masters of the High Litha. The ghosts coming out of our pit are mindless and hungry for blood. The job of the Misttalkers is to return such spirits to their rest._";

begintalknode;
	state = 15;
	nextstate = 16;
	condition = 1;
	question = "_How did you get all these ghosts?_";
	text1 = "_We were expanding a tunnel, looking for precious crystals and ore. We broke into an ancient stone chamber. Then the ghosts flowed out of it. They are fragile things, but we must spend all our time destroying them._";
	text2 = "_We were only able to send scouts in there once. There were ancient stairs, down into some long-forgotten lower crypts._";

begintalknode;
	state = 16;
	nextstate = 17;
	condition = 1;
	question = "_What is down the stairs?_";
	text1 = "_None of us were foolhardy to go down there. We don't have the strength. That is the realm of the Misttalkers._";
	text2 = "_Of course, you are powerful, and we have heard that you like a good hunt. If you needed more quicksilver ..._";

begintalknode;
	state = 17;
	nextstate = -1;
	condition = gf(44,12) == 0;
	question = "_I don't want to tamper with such deep, deadly forces._";
	text1 = "_I am not surprised. You have greater duties. Excuse us. We need to rest and prepare for the next attack._";
	action = END_TALK;
	
begintalknode;
	state = 17;
	nextstate = 18;
	condition = 1;
	question = "_Perhaps I can help._";
	text1 = "Dhregn nods. _We thought you might be tempted, and we'll pay a valuable bounty for Haven's help. We broke into the lower tunnels in the northeast corner. That is the best place to investigate. That's where the stairs down are._";
	code =
		sf(44,12,1);
	break;
	
begintalknode;
	state = 18;
	nextstate = -1;
	condition = 1;
	question = "_What should I do when I'm down there?_";
	text1 = "_Ummm ... I don't know how to be rid of them, I am but a trader. I do know that, when shades are old enough to lose all memories and thoughts, they must be returned to rest. With blades and fire._";
	text2 = "_We will rest and prepare for the next assault. Good hunting to you._";
	action = END_TALK;
	
begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(44,12) > 0 && gf(43,16) < 2 && gf(44,11) > 0;
	question = "_I have calmed your spirits._";
	text1 = "You tell the exhausted warriors your tale. They are suitably impressed. _We are grateful. You should go to Jajayim and talk to Kieron Stoff. He is the one who can make sure your bounty is sent to you._";
	
begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(43,16) > 1;
	question = "_How is this claim doing?_";
	text1 = "_We are reclaiming the mines now, and cinnabar is being sent out again. Better, we've started to explore the crypts below. We may be able to sell access to it to the Erudico. You have brought great prosperity to our clan._";
	text2 = "_Thank you, Haven. We will not forget it._";
	
	
//

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 40;
	condition = 1;
	question = "Name";
	text1 = "When you set foot into the magic circle, the draft below you lifts up another ghost. She alights on the floor in front of you. She is more solid than the other ghosts. She looks like a shaman, perhaps, or other wise woman.";
	text2 = "She stands up tall, points at you, and makes a bold proclamation. However, you can't understand a word of it.";
	code =
		set_dialogue_pic(853); // 
	break;

begintalknode;
	state = 40;
	nextstate = 41;
	condition = 1;
	question = "_Hi!_";
	text1 = "The shade looks confused. She shakes her head, offended that you would speak such gibberish to her.";

begintalknode;
	state = 40;
	nextstate = 41;
	condition = 1;
	question = "_I am [P] [N] of the Empire of Haven._";
	text1 = "The shade looks confused. She shakes her head, offended that you would speak such gibberish to her.";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "_This crypt belongs to the living now._ Attack.";
	text1 = "You lunge at the angry spirit. She raises her arms, and more ghosts float up out of the depths. Their final vengeance begins.";
	action = END_TALK;
	
begintalknode;
	state = 41;
	nextstate = 42;
	condition = 1;
	question = "_Your time is long past._";
	text1 = "You keep trying to talk to the angry spirit. There is a long process of attempted communication. Little by little, her spirit starts to lose its coherence.";
	
begintalknode;
	state = 41;
	nextstate = 42;
	condition = 1;
	question = "_You are bothering the nice miners upstairs._";
	text1 = "You keep trying to talk to the angry spirit. There is a long process of attempted communication. Little by little, her spirit starts to lose its coherence.";
	
begintalknode;
	state = 41;
	nextstate = 42;
	condition = 1;
	question = "_I want to learn about your people._";
	text1 = "You keep trying to talk to the angry spirit. There is a long process of attempted communication. Little by little, her spirit starts to lose its coherence.";

begintalknode;
	state = 42;
	nextstate = -1;
	condition = 1;
	question = "Keep talking.";
	text1 = "She continues to fade. You continue to talk. Soon, she loses her patience and realizes that, if she's going to dine on your life essence, she has to do it now. She raises her arms, and more ghosts float up out of the depths. Their final vengeance begins.";
	action = END_TALK;
	code =
		force_char_status(4441,1,10);
	break;

	
//

begintalknode;
	tag = 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = "There is an ancient chest here, placed to store the forgotten treasures of this crypt.";
	text2 = "You've cleaned it out already.";
	text3 = "You gently touch it. It is icy cold. There were symbols carved into the latch. Some of them look disturbingly skully.";
	code =
		if (gf(44,15) == 0)
			rs(2);
			else rs(3);
	break;
	
begintalknode;
	state = 70;
	nextstate = -1;
	condition = gf(44,15) == 0;
	question = "Open the chest.";
	text1 = "You open the chest, revealing a trove of gold and silver coins. You also find a steel necklace. A row of drake fangs hangs from it.";
	text2 = "There is a draft of warm air. The smell of sulfur burns your nostrils. You have angered the spirits of the tomb.";
	action = END_TALK;
	code =
		sf(44,15,1);
		change_coins(143,TRUE);
		reward_give(502);
		activate_hidden_group(5);
	break;
	
begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "Leave the chest alone.";
	text1 = "You back away.";
	action = END_TALK;


//


begintalknode;
	tag = 100;
	state = -1;
	nextstate = 100;
	condition = 1;
	question = "Name";
	text1 = "There is an ancient chest here, placed to store the forgotten treasures of this crypt.";
	text2 = "You've cleaned it out already.";
	text3 = "You gently touch it. It is icy cold. There were symbols carved into the latch. Some of them look disturbingly skully.";
	code =
		if (gf(44,16) == 0)
			rs(2);
			else rs(3);
	break;
	
begintalknode;
	state = 100;
	nextstate = -1;
	condition = gf(44,16) == 0;
	question = "Open the chest.";
	text1 = "You open the chest, revealing a trove of gold and silver coins. You also find a beautiful silver ring, dotted with tiny jewels.";
	text2 = "There is a draft of warm air. The smell of sulfur burns your nostrils. You have angered the spirits of the tomb.";
	action = END_TALK;
	code =
		sf(44,16,1);
		change_coins(164,TRUE);
		reward_give(518);
		activate_hidden_group(6);
	break;
	
begintalknode;
	state = 100;
	nextstate = -1;
	condition = 1;
	question = "Leave the chest alone.";
	text1 = "You back away.";
	action = END_TALK;


//

begintalknode;
	tag = 130;
	state = -1;
	nextstate = 130;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 130;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

//

begintalknode;
	tag = 160;
	state = -1;
	nextstate = 160;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 160;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
		
//

begintalknode;
	tag = 190;
	state = -1;
	nextstate = 190;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 190;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
				